Handling out-of-sequence data in a streaming environment

ABSTRACT

Computer-implemented method, system, and computer program product for processing data in an out-of-order manner in a streams computing environment. A windowing condition is defined such that incoming data tuples are processed within a specified time or count of each other. Additionally, the windowing condition may be based on a specified attribute of the data tuples. If the tuples are not processed within the constraints specified by the windowing condition, the unprocessed tuples may be discarded, i.e., not processed, to optimize operator performance.

BACKGROUND

While computer databases have become extremely sophisticated, thecomputing demands placed on database systems have also increased at arapid pace. Database systems are typically configured to separate theprocess of storing data from accessing, manipulating or using datastored in the database. More specifically, databases use a model wheredata is first stored, then indexed, and finally queried. However, thismodel cannot meet the performance requirements of some real-timeapplications. For example, the rate at which a database system canreceive and store incoming data limits how much data can be processed orotherwise evaluated. This, in turn, can limit the ability of databaseapplications to process large amounts of data in real-time.

SUMMARY

Embodiments disclosed herein provide a computer-implemented method,system, and computer program product to perform an operation, theoperation beginning by providing multiple processing elements includingone or more operators, the operators configured to process streamingdata tuples. The operation then establishes an operator graph ofmultiple operators, the operator graph defining at least one executionpath in which a first operator is configured to receive data tuples fromat least one upstream operator and transmit data tuples to at least onedownstream operator. The operation then defines a windowing conditionspecifying at least one rule for processing data tuples. The operationthen, responsive to receiving, at a first operator, an indication toenforce the windowing condition on the first operator, processes a firstset of data tuples received by the first operator. The operation, whileprocessing the first set of data tuples and upon determining that thewindowing condition has been satisfied, ceases processing the first setof data tuples, where at least one data tuple is not processed, andproceeds to process a second set of data tuples.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

So that the manner in which the above recited aspects are attained andcan be understood in detail, a more particular description ofembodiments of the disclosure, briefly summarized above, may be had byreference to the appended drawings.

It is to be noted, however, that the appended drawings illustrate onlytypical embodiments of this disclosure and are therefore not to beconsidered limiting of its scope, for the disclosure may admit to otherequally effective embodiments.

FIGS. 1A-1B illustrate a computing infrastructure configured to executea streams computing application, according to embodiments disclosedherein.

FIG. 2 is a more detailed view of the compute node of FIGS. 1A-1B,according to one embodiment disclosed herein.

FIG. 3 is a more detailed view of the server management system of FIGS.1A-1B, according to one embodiment disclosed herein.

FIG. 4 is a flowchart illustrating a method to handle out-of-sequencedata in a streams computing environment, according to one embodimentdisclosed herein.

FIG. 5 is a flowchart illustrating a method to define a windowingcondition to handle out-of-sequence data in a streams computingenvironment, according to one embodiment disclosed herein.

FIG. 6 is a flowchart illustrating a method to trigger a windowingcondition to handle out-of-sequence data in a streams computingenvironment, according to one embodiment disclosed herein.

FIG. 7 is a schematic illustrating techniques for handlingout-of-sequence data in a streams computing environment, according toone embodiment disclosed herein.

DETAILED DESCRIPTION

Embodiments disclosed herein provide techniques for handling data in anout-of-order fashion in a predefined environment such as a streamsprogramming environment. Environments, such as batch processing or queueprocessing, may handle data in the order in which the data arrives or ina predetermined sort order established by a queuing mechanism. Instreams programming, data may often be processed in the order in whichthe data arrives. At least in some cases, streams programming may bebetter equipped—at least relative to other environments—to handlesituations in which there is too much incoming data to process in atimely manner. Many computing systems simply cannot process all incomingdata and certainly cannot process it in the order in which it arrives.

Accordingly, one embodiment provides an operation for handling data inan out-of-order fashion in a streams programming environment. Theoperation begins by providing multiple processing elements, each havingone or more operators configured to process streaming data tuples. Theoperation then establishes an operator graph of multiple operators, theoperator graph defining at least one execution path in which a firstoperator is configured to receive data tuples from at least one upstreamoperator and transmit data tuples to at least one downstream operator.The operation then defines a windowing condition specifying at least onerule for processing data tuples. The operation then, responsive toreceiving, at a first operator an indication to enforce the windowingcondition on the first operator, processes a first set of data tuplesreceived by the first operator. The operation, while processing thefirst set of data tuples and upon determining that the windowingcondition has been satisfied, ceases processing the first set of datatuples, where at least one data tuple of the first set of data tuples isnot processed, and proceeds to process a second set of data tuples.

Disclosed are mechanisms that enable streams computing applications tohandle data in an out-of-order fashion. In the context of streamsapplications, windowing conditions are used to process the data in anout-of-order fashion. The windowing conditions may be defined by thestreaming data, but thought and care must be used when implementing thedetails of what is meant by processing data out of order. If a tuple isbeing processed one hour after the fact, it may be too late to do so insome applications. Likewise, processing data too far removed from itscongruent data may also have similar negative connotations. Therefore,in a streams computing environment, the timeliness of processingout-of-order data may be defined by a windowing condition. Theprocessing of data in an out-of-order manner may then be allowed whenthe situation presents itself.

In the following, reference is made to embodiments of the disclosure.However, it should be understood that the disclosure is not limited tospecific described embodiments. Instead, any combination of thefollowing features and elements, whether related to differentembodiments or not, is contemplated to implement and practice thedisclosure. Furthermore, although embodiments of the disclosure mayachieve advantages over other possible solutions and/or over the priorart, whether or not a particular advantage is achieved by a givenembodiment is not limiting of the disclosure. Thus, the followingaspects, features, embodiments and advantages are merely illustrativeand are not considered elements or limitations of the appended claimsexcept where explicitly recited in a claim(s). Likewise, reference to“the invention” shall not be construed as a generalization of anyinventive subject matter disclosed herein and shall not be considered tobe an element or limitation of the appended claims except whereexplicitly recited in a claim(s).

As will be appreciated by one skilled in the art, aspects of the presentdisclosure may be embodied as a system, method or computer programproduct. Accordingly, aspects of the present disclosure may take theform of an entirely hardware embodiment, an entirely software embodiment(including firmware, resident software, micro-code, etc.) or anembodiment combining software and hardware aspects that may allgenerally be referred to herein as a “circuit,” “module” or “system.”Furthermore, aspects of the present disclosure may take the form of acomputer program product embodied in one or more computer readablemedium(s) having computer readable program code embodied thereon.

Any combination of one or more computer readable medium(s) may beutilized. The computer readable medium may be a computer readable signalmedium or a computer readable storage medium. A computer readablestorage medium may be, for example, but not limited to, an electronic,magnetic, optical, electromagnetic, infrared, or semiconductor system,apparatus, or device, or any suitable combination of the foregoing. Morespecific examples (a non-exhaustive list) of the computer readablestorage medium would include the following: an electrical connectionhaving one or more wires, a portable computer diskette, a hard disk, arandom access memory (RAM), a read-only memory (ROM), an erasableprogrammable read-only memory (EPROM or Flash memory), an optical fiber,a portable compact disc read-only memory (CD-ROM), an optical storagedevice, a magnetic storage device, or any suitable combination of theforegoing. In the context of this document, a computer readable storagemedium may be any tangible medium that can contain, or store a programfor use by or in connection with an instruction execution system,apparatus, or device.

A computer readable signal medium may include a propagated data signalwith computer readable program code embodied therein, for example, inbaseband or as part of a carrier wave. Such a propagated signal may takeany of a variety of forms, including, but not limited to,electro-magnetic, optical, or any suitable combination thereof. Acomputer readable signal medium may be any computer readable medium thatis not a computer readable storage medium and that can communicate,propagate, or transport a program for use by or in connection with aninstruction execution system, apparatus, or device.

Program code embodied on a computer readable medium may be transmittedusing any appropriate medium, including but not limited to wireless,wireline, optical fiber cable, RF, etc., or any suitable combination ofthe foregoing.

Computer program code for carrying out operations for aspects of thepresent disclosure may be written in any combination of one or moreprogramming languages, including an object oriented programming languagesuch as Java, Smalltalk, C++ or the like and conventional proceduralprogramming languages, such as the “C” programming language or similarprogramming languages. The program code may execute entirely on theuser's computer, partly on the user's computer, as a stand-alonesoftware package, partly on the user's computer and partly on a remotecomputer or entirely on the remote computer or server. In the latterscenario, the remote computer may be connected to the user's computerthrough any type of network, including a local area network (LAN) or awide area network (WAN), or the connection may be made to an externalcomputer (for example, through the Internet using an Internet ServiceProvider).

Aspects of the present disclosure are described below with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems) and computer program products according to embodiments of thedisclosure. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, can be implemented bycomputer program instructions. These computer program instructions maybe provided to a processor of a general purpose computer, specialpurpose computer, or other programmable data processing apparatus toproduce a machine, such that the instructions, which execute via theprocessor of the computer or other programmable data processingapparatus, create means for implementing the functions/acts specified inthe flowchart and/or block diagram block or blocks.

These computer program instructions may also be stored in a computerreadable medium that can direct a computer, other programmable dataprocessing apparatus, or other devices to function in a particularmanner, such that the instructions stored in the computer readablemedium produce an article of manufacture including instructions whichimplement the function/act specified in the flowchart and/or blockdiagram block or blocks.

The computer program instructions may also be loaded onto a computer,other programmable data processing apparatus, or other devices to causea series of operational steps to be performed on the computer, otherprogrammable apparatus or other devices to produce a computerimplemented process such that the instructions which execute on thecomputer or other programmable apparatus provide processes forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks.

Embodiments of the disclosure may be provided to end users through acloud computing infrastructure. Cloud computing generally refers to theprovision of scalable computing resources as a service over a network.More formally, cloud computing may be defined as a computing capabilitythat provides an abstraction between the computing resource and itsunderlying technical architecture (e.g., servers, storage, networks),enabling convenient, on-demand network access to a shared pool ofconfigurable computing resources that can be rapidly provisioned andreleased with minimal management effort or service provider interaction.Thus, cloud computing allows a user to access virtual computingresources (e.g., storage, data, applications, and even completevirtualized computing systems) in “the cloud,” without regard for theunderlying physical systems (or locations of those systems) used toprovide the computing resources.

Typically, cloud computing resources are provided to a user on apay-per-use basis, where users are charged only for the computingresources actually used (e.g., an amount of storage space used by a useror a number of virtualized systems instantiated by the user). A user canaccess any of the resources that reside in the cloud at any time, andfrom anywhere across the Internet. In context of the present disclosure,a user may access applications or related data available in the cloud.For example, the nodes used to create a streams computing applicationmay be virtual machines hosted by a cloud service provider. Doing soallows a user to access this information from any computing systemattached to a network connected to the cloud (e.g., the Internet).

FIGS. 1A-1B illustrate a computing infrastructure configured to executea streams computing application, according to one embodiment of thedisclosure. As shown, the computing infrastructure 100 includes amanagement system 105 and a plurality of compute nodes 130 ₁₋₄, eachconnected to a communications network 120. Also, the management system105 includes an operator graph 132 and a stream manager 134. Asdescribed in greater detail below, the operator graph 132 represents astreams computing application beginning from one or more operators inone or more source processing elements (PEs) through to one or moreoperators in one or more sink PEs. This flow from source to sink is alsogenerally referred to herein as an execution path. Generally, dataattributes flow into an operator of a source PE of a streams computingapplication and are processed by that operator. Typically, operatorsreceive an N-tuple of data attributes from the stream as well as emit anN-tuple of data attributes into the stream (except for operators in asink PE where the stream terminates).

In general, a “tuple” is a single instance of a set of data attributesthat follow the formatting of a schema, where the schema establishes aset of typed data attributes that may be used. For example, the tuplemay be a chunk or portion of divisible data such as a data type (e.g.,string, integer, Boolean, etc.) or combination of data types. In oneembodiment, a “tuple” may include one or more attributes with anassigned value—e.g., Tuple 1: {sym=“Fe”, no=26} where “sym” and “no” arepossible attributes in the schema (i.e., a string and integer,respectively) and “Fe” and “26” are the values.

Of course, the N-tuple received by an operator need not be the sameN-tuple sent downstream. Additionally, operators could be configured toreceive or emit tuples in other formats (e.g., the PEs or operatorscould exchange data marked up as XML documents). Furthermore, eachoperator within a PE may be configured to carry out any form of dataprocessing functions on the received tuple, including, for example,writing to database tables or performing other database operations suchas data joins, splits, reads, etc., as well as performing other dataanalytic functions or operations.

The stream manager 134 may be configured to monitor a streams computingapplication running on the compute nodes 130 ₁₋₄, as well as to changethe deployment of the operator graph 132. The stream manager 134 maymove processing elements (PEs) from one compute node 130 to another, forexample, to manage the processing loads of the compute nodes 130 in thecomputing infrastructure 100. Further, stream manager 134 may controlthe streams computing application by inserting, removing, fusing,un-fusing, or otherwise modifying the processing elements and operators(or what data tuples flow to the processing elements and operators)running on the compute nodes 130 ₁₋₄. One example of a streams computingapplication is IBM®'s InfoSphere® Streams (InfoSphere® is a trademark ofInternational Business Machines Corporation, registered in manyjurisdictions worldwide).

FIG. 1B illustrates an example processing element graph that includesten processing elements (labeled as PE1-PE10) running on the computenodes 130 ₁₋₄. A processing element is composed of one or more operatorsfused together into an independently running process with its ownprocess ID (PID) and memory space. In cases where two (or more)processing elements are running independently, inter-processcommunication may occur using a “transport” (e.g., a network socket, aTCP/IP socket, or shared memory). However, when operators are fusedtogether, the fused operators can use more rapid communicationtechniques for passing tuples among operators in each processingelement.

As shown, the processing element graph begins at a source 135 (thatflows into the processing element labeled PE1) and ends at sink 140 ₁₋₂(that flows from the processing elements labeled as PE6 and PE10).Compute node 130 ₁ includes the processing elements PE1, PE2 and PE3.Source 135 flows into operators in the processing element PE1, which inturn emits tuples that are received by PE2 and PE3. For example,operators in PE1 may split data attributes received in a tuple and passsome data attributes to PE2, while passing other data attributes to PE3.Data that flows to PE2 is processed by the operators contained in PE2,and the resulting tuples are then emitted to the operators in PE4 oncompute node 130 ₂. Likewise, the data tuples emitted by the operatorsin PE4 flow to the operators sink PE6 140 ₁. Similarly, data tuplesflowing from operators in PE3 to operators in PE5 also reach operatorsin sink PE6 140 ₁. Thus, in addition to being a sink for this exampleprocessing element graph, operators in PE6 could be configured toperform a join operation, combining tuples received from operators inPE4 and PE5. This example processing element graph also shows datatuples flowing from PE3 to PE7 on compute node 130 ₃, which itself showsdata tuples flowing to operators in PE8 and looping back to operators inPE7. Data tuples emitted from operators in PE8 flow to operators in PE9on compute node 130 ₄, which in turn emits tuples to be processed byoperators in sink PE10 140 ₂. Once processed by operators in a sinkprocessing element, for example PE10 140 ₂, data tuples may be saved ina file sink (not pictured) for storage. The file sink may be any storageunit capable of storing data.

Because a processing element is a collection of fused operators, it isequally correct to describe the operator graph as execution pathsbetween specific operators, which may include execution paths todifferent operators within the same processing element. FIG. 1Billustrates execution paths between processing elements for the sake ofclarity.

In one embodiment, the stream manger 134 may be able to communicate withother operator graphs executing in a streams computing application. Thatis, the compute nodes 130 may host operator graphs executing inparallel. The stream manager 134 may be able to communicate with astream manager associated with those parallel operator graphs using, forexample, a shared memory where messages and commands may be passed.Alternatively, stream manager 134 may be part of a hierarchicalarrangement of stream managers that allow the different stream managersto communicate. The stream manager 134 may use the manager hierarchy orthe shared memory to instruct a different stream manager to optimize anoperator graph in the streams computing application that is sharing thesame compute nodes 130 (i.e., hardware resources) as the operator graphshown in FIG. 1B. Additionally, the hierarchical arrangement may managestream managers across different compute nodes, for example, a firststream manager 134 for a first streams computing application owned by afirst customer and a second stream manager 134 for a second streamscomputing application owned by a second customer.

FIG. 2 is a more detailed view of the compute node 130 of FIGS. 1A-1B,according to one embodiment disclosed herein. As shown, the compute node130 includes, without limitation, at least one CPU 205, a networkinterface 215, an interconnect 220, a memory 225, and storage 230. Thecompute node 130 may also include an I/O devices interface 210 used toconnect I/O devices 212 (e.g., keyboard, display and mouse devices) tothe compute node 130.

Each CPU 205 retrieves and executes programming instructions stored inthe memory 225. Similarly, the CPU 205 stores and retrieves applicationdata residing in the memory 225. The interconnect 220 is used totransmit programming instructions and application data between each CPU205, I/O devices interface 210, storage 230, network interface 215, andmemory 225. CPU 205 is included to be representative of a single CPU,multiple CPUs, a single CPU having multiple processing cores, and thelike. In one embodiment, a PE 235 is assigned to be executed by only oneCPU 205 although in other embodiments the operators 240 of a PE 235 maycomprise one or more threads that are executed on a plurality of CPUs205. The memory 225 is generally included to be representative of arandom access memory (e.g., DRAM or Flash). Storage 230, such as a harddisk drive, solid state device (SSD), or flash memory storage drive, maystore non-volatile data.

In this example, the memory 225 includes a plurality of processingelements 235. Each PE 235 includes a collection of operators 240 thatare fused together. As noted above, each operator 240 may provide asmall chunk of code configured to process data flowing into a processingelement (e.g., PE 235) and to emit data to other operators 240 in thesame PE or to other PEs in the streams computing application. Suchprocessing elements may be on the same compute node 130 or on othercompute nodes that are accessible via communications network 120.

As shown, storage 230 contains a buffer 260. Although shown as being instorage, the buffer 260 may be located in the memory 225 of the computenode 130 or a combination of both. Moreover, storage 230 may includestorage space that is external to the compute node 130.

FIG. 3 is a more detailed view of the server management system 105 ofFIG. 1, according to one embodiment disclosed herein. As shown, servermanagement system 105 includes, without limitation, a CPU 305, a networkinterface 315, an interconnect 320, a memory 325, and storage 330. Theclient system 130 may also include an I/O device interface 310connecting I/O devices 312 (e.g., keyboard, display and mouse devices)to the server management system 105.

Like CPU 205 of FIG. 2, CPU 305 is configured to retrieve and executeprogramming instructions stored in the memory 325 and storage 330.Similarly, the CPU 305 is configured to store and retrieve applicationdata residing in the memory 325 and storage 330. The interconnect 320 isconfigured to move data, such as programming instructions andapplication data, between the CPU 305, I/O devices interface 310,storage unit 330, network interface 305, and memory 325. Like CPU 205,CPU 305 is included to be representative of a single CPU, multiple CPUs,a single CPU having multiple processing cores, and the like. Memory 325is generally included to be representative of a random access memory.The network interface 315 is configured to transmit data via thecommunications network 120. Although shown as a single unit, the storage330 may be a combination of fixed and/or removable storage devices, suchas fixed disc drives, removable memory cards, optical storage, SSD orflash memory devices, network attached storage (NAS), or connections tostorage area-network (SAN) devices.

As shown, the memory 325 stores a stream manager 134. Additionally, thestorage 330 includes a primary operator graph 132. The stream manager134 may use the primary operator graph 132 to route tuples to PEs 235for processing. The stream manager 134 also includes an order manager333, which is configured to monitor and reconfigure the order in whichdata tuples are processed in an operator. The order manager 333 maydefine streams-like window conditions such that when data flows throughthe operator graph 132, the tuples are processed within context of eachother. The contexts may be defined by a time relationship, a tuple countrelationship, and/or an attribute value relationship. For example, theorder manager 333 may impose a condition that data tuples must beprocessed within two minutes of their related data tuples or withinfifty tuples of their related data tuples. Additionally, an attributevalue, such as a product price, may be monitored by the buffer manager333 to detect a fluctuation in the price that exceeds a specifiedthreshold. Once the condition is triggered, the order manager 333 maycause the operator to cease processing of unprocessed tuples meeting thecondition. The order manager 333 may serve to impose a windowingcondition on an operator which does not support windowing by default, inorder to implement the ordered processing rules disclosed herein.

At least in some embodiments, streams computing applications may provideat least two types of windows, including tumbling windows and slidingwindows. An operator may not necessarily support windows by default.Both tumbling and sliding windows store tuples preserving the order ofarrival at the operator but differ in how they handle tuple evictions.Rather than keeping all tuples ever inserted, windows are configured toevict expired tuples. In this respect, tumbling windows operate inbatches; when a tumbling window is full, all the tuples in the windoware evicted. This is called a window flush. After a tumbling window hasbeen flushed, the window is not triggered until the buffer 260 containsthe requisite number of tuples or a predefined period of time haselapsed. On the other hand, sliding windows operate in an incrementalfashion. When a sliding window is full, future tuple insertionsgenerally result in evicting the oldest tuples in the window. Triggeringa new sliding window may occur as a new tuple is received or when apredefined period of time has elapsed. The details of tuple eviction ina sliding window are defined by the eviction policy. In both a tumblingand sliding window, the windowing policy defines a trigger policy basedon a predefined number of received tuples or the expiration of apredefined period of time.

FIG. 4 is a flowchart illustrating a method 400 to handleout-of-sequence data in a streams computing environment, according toone embodiment disclosed herein. Generally, the steps of the method 400may define windowing conditions for the ordered (and unordered)processing of data tuples. At step 410, which is further described ingreater detail below in conjunction with FIG. 5, a windowing conditionis defined. The windowing condition allows a programmer to definecontextual constraints within which data tuples must be processed. Ifthe constraints are not met, subsequent processing may be deemeduntimely and unnecessary, and unprocessed data tuples not meeting theseconstraints may not be processed, in order to reduce the overallprocessing load of an operator (and of the operator graph as a whole).The windowing conditions may be defined as part of the properties ofeach operator in the operator graph and enforced at compilation/runtime.At step 420, an operator of the operator graph may receive an indicationto begin applying the windowing conditions in its processing operations.In one embodiment, the indication is an out-of-band signal coming to theoperator which triggers the application of the windowing conditions. Theout-of-band signal may be sent by the order manager 333. In anotherembodiment, a tuple arriving at an operator may trigger the applicationof the windowing conditions at the operator, i.e., all data tuplesprocessed by the operator may be subject to the windowing conditions.

At step 430, the operator may process a first set of data tuples. Thefirst set of data tuples may include any number of data tuplessequentially received at the operator. In one embodiment, the first setof tuples includes a window of tuples. The operator may process the datatuples of the first set one at a time, in the order in which they arereceived. However, the operator may not be able to process each datatuple of the first set within the constraints imposed by the windowingcondition. For example, the windowing condition may specify a two-minutewindow within which data tuples of the first set are to be processed. Ifthe operator is unable to process all tuples received within thetwo-minute window, the windowing condition is triggered (step 440). Inone embodiment, the windowing condition may be triggered by the ordermanager 333. Triggering the windowing condition is further described ingreater detail below in conjunction with FIG. 5. In one embodiment,triggering the windowing condition may include ceasing the processing ofdata tuples of the first data set—i.e., refraining from processing anyheretofore unprocessed data tuples. At step 450, the operator may beginprocessing a second set of data tuples after the windowing condition hasbeen triggered. In one embodiment, the second set of data tuples may bea second window of data tuples. The second set of data tuples may bedistinct from the first set of data tuples, as is the case for tumblingwindows, or alternatively, the first and second set of data tuples maycontain at least one duplicate data tuple, as in the case for slidingwindows.

FIG. 5 is a flowchart illustrating a method 500 corresponding to step410 to define a windowing condition to handle out-of-sequence data in astreams computing environment, according to one embodiment disclosedherein. A windowing condition may be defined in any number of ways. Forexample, a streams computing programmer may define a specific windowingcondition. Additionally, the order manager 333 may provide a predefinedset of windowing conditions. Although depicted as a flowchart, one,several, or all of the steps of the method 500 may be used to definewindowing conditions. Generally, once a windowing condition istriggered, the order manager 333 may take any number of actions,including refraining from processing the unprocessed tuples at theoperator. At step 510, a windowing condition is defined to be based on acount of tuples received at the operator equaling a predefined count ofdata tuples. For example, the windowing condition may specify that datatuples are to be processed within forty data tuples of each other. If adata tuple in the first set of forty tuples is not processed by the timethe fortieth data tuple is received at the operator, the windowingcondition may be triggered by the order manager 333.

At step 520, a windowing condition is defined to be based on theexpiration of a predefined period of time. In this context, tuples areto be processed within the predefined period of time. A programmer orthe order manager 333 may specify the predefined period of time. Forexample, the predefined period of time may be two minutes. Once thewindowing condition is applied and a first tuple of a first set oftuples is received, the buffer manager 333 may start a two-minute timer.All tuples received within that two-minute time period should thereforebe processed by the operator; otherwise, the windowing condition will betriggered. For example, if two hundred tuples are received in twominutes, yet only fifty tuples are processed, then the windowingcondition may be triggered.

At step 530, a windowing condition may be defined to be based on achange in an attribute value of the data tuples, where the changeexceeds a predefined threshold. Depending on the embodiment, aprogrammer or the order manager 333 may specify the predefinedthreshold. For example, the windowing condition may specify that theorder manager 333 monitor a price attribute of products being sold by anonline ordering application. The condition may specify that if the priceattribute of data tuples fluctuates by more than the predefinedthreshold, for example, two cents, the condition should be triggered.Therefore, once the order manager 333 detects a price attributeexceeding the two-cent threshold, the windowing condition may betriggered.

At step 540, a windowing condition may be defined to be based on a countof times a data tuple is processed, where the count does not exceed apredefined threshold. As described above, a sliding window operates inan incremental fashion. When one tuple is processed, the processed tupleis evicted from the window, and a new tuple enters the window. This mayresult in the processing of a single tuple numerous times, as the tuplemay appear in multiple windows. Therefore, a programmer, or the buffermanager 333 may specify a predefined threshold which indicates themaximum number of times a data tuple may be processed. Thus, the buffermanager 333 may monitor the number of times a data tuple is processed byan operator. If the count of times the data tuple is processed equalsthe threshold, the data tuple may continue to remain in future windowsuntil it is evicted, but will not be processed again by that operator.For example, if the threshold specifies that a data tuple cannot beprocessed more than four times, once the tuple has been four times(i.e., as a member of four different sliding windows), it will not beprocessed again, regardless of the number of subsequent windows in whichit is a member.

FIG. 6 is a flowchart illustrating a method 600 corresponding to step440 to trigger a windowing condition to handle out-of-sequence data in astreams computing environment, according to one embodiment disclosedherein. In one embodiment, the order manager 333 performs the steps ofthe method 600. Generally, the method 600 is triggered while an operatoris processing a first set of data tuples subject to the windowingcondition imposed on the operator at step 420 and the windowingcondition is met. For example, if the windowing condition specifies thatall data tuples must be processed within a two-minute time frame of eachother, and two minutes have elapsed since a first data tuple of a firstset has been received, the windowing condition may be triggered. At step610, the order manager 333 may determine whether unprocessed data tuplesremain in the first set, i.e., those data tuples received within the twominute time frame. For example, in the first two minutes, five hundredtuples may have been received, yet only four hundred were processed. Ifunprocessed tuples remain, the method proceeds to step 620. If alltuples were processed, the method proceeds to step 650. At step 620, theorder manager 333 may provide an indication to the operator to ceaseprocessing the unprocessed tuples from the first set. Alternatively, theoperator may be pre-programmed to cease processing the tuples without aninstruction from the order manager 333. By implementing this logic, theorder manager 333 may ensure or improve a likelihood that all datatuples are processed in a timely manner, as specified by the windowingconditions. In ceasing the processing of the unprocessed data tuples,the order manager 333 may specify that the unprocessed tuples may bediscarded from the operator graph.

At step 630, the buffer manager 333, or the operator itself, maydetermine whether the operator properties specify that tuples processedprior to the triggering of the windowing condition should be removedfrom the operator graph (or from a file sink containing fully processeddata tuples). If the settings specify to remove processed data tuples,the method proceeds to step 640. Otherwise, the data method proceeds tostep 650, and the processed tuples continue to flow through the operatorgraph. At step 640, the processed tuples are removed from the operatorgraph or the file sink. In one embodiment, data tuples are marked by aunique identifier which allows subsequent operators to identify andremove the data tuples, based on a signal indicating that tuples havingspecified identifiers should be removed. The tuples may be removed fromthe current operator, or a downstream operator which received theprocessed data tuples from the current operator. For example, operator Amay process tuples and send them to operator B, which may process thetuples and sends them to operator C. The tuples, upon triggering of thewindowing condition, may be removed from any of operator A, B, or C,depending on their location. At step 650, the operator begins processinga second set of data tuples. Once the operator begins processing thesecond set of data tuples, the steps of the method 400 may begin anew,such that the buffer manager 333 ensures or improves the timelyprocessing of data tuples in the operator.

FIG. 7 is a schematic 700 illustrating techniques for handlingout-of-sequence data in a streams computing environment, according toone embodiment disclosed herein. Generally, the schematic 700 includestables 701-704, each showing the application of a different windowingcondition. For example, table 701 shows a count condition 705 where,once ten tuples are received, all tuples must be processed, or thewindowing condition is triggered. Table 701 shows tuples 1-10, however,when the count condition 705 is met, only tuples 1-3 have beenprocessed. Stated differently, the operator begins processing the datatuples as they are received, but has only completed processing 3 tupleswhen the tenth tuple arrives. Because the tuples 4-10 have not beenprocessed, the windowing condition is triggered, and the tuples 4-10 maynot be processed. Furthermore, the tuples 1-3 (as well as 4-10) may beremoved from the operator graph. A new window of tuples may then bereceived by the operator, and the processing may resume according to thewindowing condition restrictions.

Table 702 shows a time condition 706, which, for example, may specifythat data tuples must be processed within five minutes of each other,according to one embodiment. The operator begins processing tuples asthey are received. However, when five minutes have elapsed and the timecondition 706 is met, tuples 11-30 have been received, yet only tuples11-16 have been processed. Tuples 17-30, received within the five-minutetime frame, stand unprocessed and may hence remain unprocessed in favorof processing a new window of data tuples. Furthermore, the tuples 11-30may be removed from the operator graph.

Table 703 shows an attribute condition 708, which may specify that theprice attribute of a tuple cannot exceed two cents, according to oneembodiment. As shown, the first tuple 31 has a value of $3.33, andtuples 32-34 are within two cents of this price. Once the condition 708is met, when tuples 35-37 arrive having a price attribute value of$3.99, the condition is met, and tuples 35-37 may not be processed.Furthermore, the tuples 31-34 and 35-37 may be removed from the operatorgraph. A new window of tuples may then be received by the operator, andthe processing may resume according to the windowing conditionrestrictions.

Table 704 shows a processing count threshold 709, which may specify thattuples of a sliding window cannot be processed more than four times,according to one embodiment. As shown, tuples 38-39 have been processedfewer than four times, so they may be processed another time, as part ofa new sliding window. However, tuples 41-43 have been processed fourtimes each and will not be processed again, even though they may remainas members of subsequent windows.

Advantageously, embodiments disclosed herein allow for faster processingof data due to optimizations that can be made when the data need nolonger be processed in a predefined order. In one embodiment, aprogramming environment may be defined where a programmer can handledata in a timely manner—e.g., incoming data tuples may be handled in arelationship of time, or a count of tuples to other nearby tuples inwhich they arrive. A condition may be defined specifying that datatuples should be processed within x seconds of each other or within ytuples of each other. Streams windowing may be specified such that atuple can or cannot be processed if other tuples of nearby relevancestill exist in the window. Doing so allows for scenarios beyondtime-based or count-based processing of data and also introduces and/oraccommodates both tumbling and sliding windowing scenarios. Moreover,doing so provides an environment in which the streams computingapplication may identify conditions that allow the application toeliminate certain processing.

The flowchart and block diagrams in the Figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods and computer program products according to variousembodiments of the present disclosure. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof code, which comprises one or more executable instructions forimplementing the specified logical function(s). It should also be notedthat, in some alternative implementations, the functions noted in theblock may occur out of the order noted in the figures. For example, twoblocks shown in succession may, in fact, be executed substantiallyconcurrently, or the blocks may sometimes be executed in the reverseorder, depending upon the functionality involved. It will also be notedthat each block of the block diagrams and/or flowchart illustration, andcombinations of blocks in the block diagrams and/or flowchartillustration, can be implemented by special purpose hardware-basedsystems that perform the specified functions or acts, or combinations ofspecial purpose hardware and computer instructions.

While the foregoing is directed to embodiments of the presentdisclosure, other and further embodiments of the disclosure may bedevised without departing from the basic scope thereof, and the scopethereof is determined by the claims that follow.

1.-7. (canceled)
 8. A computer program product, comprising: acomputer-readable storage medium having computer-readable program codeembodied therewith, the computer-readable program code comprising:computer-readable program code configured to provide a plurality ofprocessing elements comprising one or more operators, the operatorsconfigured to process streaming data tuples by operation of one or morecomputer processors; computer-readable program code configured toestablish an operator graph of a plurality of operators, the operatorgraph defining at least one execution path in which a first operator ofthe plurality of operators is configured to: (i) receive data tuplesfrom at least one upstream operator and (ii) transmit data tuples to atleast one downstream operator; computer-readable program code configuredto define a windowing condition specifying at least one rule forprocessing data tuples; and computer-readable program code configuredto, responsive to receiving, at a first operator of the plurality ofoperators, an indication to enforce the windowing condition on the firstoperator: process a first set of data tuples received by the firstoperator; and while processing the first set of data tuples, upondetermining that the windowing condition has been satisfied and byoperation of one or more computer processors when executing thecomputer-readable program code: cease the processing of the first set ofdata tuples, wherein at least one data tuple of the first set of datatuples is not processed; and process a second set of data tuples.
 9. Thecomputer program product of claim 8, wherein the computer-readableprogram code further comprises: removing, from at least one of: (i) thefirst operator, and (ii) the at least one downstream operator, datatuples of the first set of data tuples processed by the first operator.10. The computer program product of claim 8, wherein thecomputer-readable program code further comprises: removing, from a datasink configured to store data tuples that are fully processed by theoperator graph, data tuples of the first set of data tuples processed bythe first operator.
 11. The computer program product of claim 8, whereinthe at least one rule is based on one of: (i) a count of data tuplesreceived by the first operator equaling a predefined count, (ii)expiration of a predefined period of time, and (iii) a change in anattribute value of the data tuples exceeding a predefined threshold. 12.The computer program product of claim 8, wherein the windowing conditionspecifies that a count of times a data tuple is processed cannot exceeda predetermined threshold, wherein the computer-readable program codefurther comprises: upon determining the windowing condition has beensatisfied: upon determining a first data tuple is a member of the secondset of data tuples, refraining from processing the first data tuple. 13.The computer program product of claim 8, wherein the computer-readableprogram code configured to receive the indication comprises one of: (i)computer-readable program code configured to receive an out-of-bandsignal; and (ii) computer-readable program code configured to receive,at the first operator, a first data tuple.
 14. The computer programproduct of claim 11, wherein the first operator does not have a window,wherein the window comprises a plurality of data tuples in an operator.15. A system, comprising: one or more computer processors; and a memorycontaining a program, which when executed by the one or more computerprocessors is configured to perform an operation comprising: providing aplurality of processing elements comprising one or more operators, theoperators configured to process streaming data tuples; establishing anoperator graph of a plurality of operators, the operator graph definingat least one execution path in which a first operator of the pluralityof operators is configured to: (i) receive data tuples from at least oneupstream operator and (ii) transmit data tuples to at least onedownstream operator; defining a windowing condition specifying at leastone rule for processing data tuples; and responsive to receiving, at afirst operator of the plurality of operators, an indication to enforcethe windowing condition on the first operator: processing a first set ofdata tuples received by the first operator; and while processing thefirst set of data tuples, upon determining that the windowing conditionhas been satisfied: ceasing the processing of the first set of datatuples, wherein at least one data tuple of the first set of data tuplesis not processed; and processing a second set of data tuples.
 16. Thesystem of claim 15, the operation further comprising: removing, from atleast one of: (i) the first operator, and (ii) the at least onedownstream operator, data tuples of the first set of data tuplesprocessed by the first operator.
 17. The system of claim 15, theoperation further comprising: removing, from a data sink configured tostore data tuples that are fully processed by the operator graph, datatuples of the first set of data tuples processed by the first operator.18. The system of claim 15, wherein the at least one rule is based onone of: (i) a count of data tuples received by the first operatorequaling a predefined count, (ii) expiration of a predefined period oftime, and (iii) a change in an attribute value of the data tuplesexceeding a predefined threshold.
 19. The system of claim 15, whereinthe windowing condition specifies that a count of times a data tuple isprocessed cannot exceed a predetermined threshold, wherein the operationfurther comprises: upon determining the windowing condition has beensatisfied: upon determining a first data tuple is a member of the secondset of data tuples, refraining from processing the first data tuple. 20.The system of claim 15, wherein receiving the indication comprises oneof: (i) receiving an out-of-band signal and (ii) receiving, at the firstoperator, a first data tuple.
 21. The system of claim 15, wherein thefirst operator does not have a window, wherein the window comprises aplurality of data tuples in an operator.